Ext.define('Usws.view.school.School', {
    extend: 'Ext.grid.Panel',
    xtype: 'School-Grid',
    store: 'School',
    title: '学校信息',
    selType:'checkboxmodel',//设定选择模式  
    multiSelect:true,//运行多选  
    layout:'fit',
    autoScroll: true,
    initComponent: function () {
    	this.tbar = [
    	             {
						  xtype: 'panel',
						  layout:'hbox',
	       	              border:false,
	       	              items:[
	 	       	              {xtype: 'button', text: '添加学校',  action: 'add' , margin:'5 5 5 5'},
	 	    	              {xtype: 'button', text: '批量删除',  action: 'deleteMore' ,margin:'5 5 5 5'}
	       	            	 ]
					  }
    	            ];
        this.columns = [
			 {text : '学校编号', width : '6%', sortable : true, dataIndex: 'code', hidden: false}
			,{text : '校名', width : '10%', sortable : true, dataIndex: 'name', hidden: false}
			,{text : '办学方式', width : '6%', sortable : true, dataIndex: 'schoolTypeName', hidden: false}
			,{text : '省', width : '6%', sortable : true, dataIndex: 'provinceName', hidden: false}
			,{text : '市', width : '6%', sortable : true, dataIndex: 'cityName', hidden: false}
			,{text : '区', width : '6%', sortable : true, dataIndex: 'districtName', hidden: false}
			,{text : '街道', width : '8%', sortable : true, dataIndex: 'street', hidden: false}
			,{text : '学校网址', width : '10%', sortable : true, dataIndex: 'websiteUrl', hidden: false}
			,{text : '首页显示', width : '6%', sortable : true, dataIndex: 'isFrontShow',
				renderer:function(value) {
					return value == 'Y' ? '显示' : '不显示';
				}
			}
			,{text : '教学阶段', width : '10%', dataIndex: 'schoolEduStages'}
			,{text : '创建者', width : '5%', sortable : true, dataIndex: 'createUserName'}
			,{text : '创建时间', width : '8%', sortable : true, dataIndex: 'createDate',renderer: Ext.util.Format.dateRenderer('Y-m-d')}
            , {
	            text:'操作',
	            sortable: false,
	            xtype: 'actioncolumn',
	            margin:'5px',
	            align:'center',
	            width : '10%',
	            items: [
					{
						icon: '/ext4/resources/images/plugin_add.gif',
					    tooltip: '添加班级',
					    action: 'addClz',
					    handler: function(grid,rowIndex,colIndex,item,e) {
					    	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
					    }
					},'-',
					{
						icon: '/ext4/resources/images/user_add.gif',
					    tooltip: '添加老师',
					    action: 'addTeacher',
					    handler: function(grid,rowIndex,colIndex,item,e) {
					    	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
					    }
					},'-', 
		            {
		            	icon: '/ext4/resources/images/cog_edit.png',
		                tooltip: '编辑',
		                action: 'edit',
		                handler: function(grid,rowIndex,colIndex,item,e) {
		                	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
		                }
		            },'-',
		            {
		                icon: '/ext4/resources/images/delete.gif',
		                tooltip: '删除',
		                action: 'delete',
		                handler: function(grid,rowIndex,colIndex,item,e) {
		                	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
		                }
		            }]
            }];
        this.bbar= {
            xtype: 'pagingtoolbar',
            store: 'School',
            pageSize: 16,
            displayInfo: true,
            firstText:'首页',
            prevText:'上一页',
            nextText:'下一页',
            beforePageText:'第',
            afterPageText:'共  {0} 页',
            displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条', 
            emptyMsg: "没有记录",
            refreshText:'刷新',
            lastText:'未页'
        };
        this.callParent();
    }
});